<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
		<title>前后端调用-post</title>
		<script src="../js/axios.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<h1>前后端调用-post测试</h1>
		</div>
		<script> 
				/**
				 * 需求:实现用户新增的操作
				 * 语法:axios.post(url,新增参数)
				 * 规则:如果post/put  传递对象则直接赋值  不需要加params
				 */
				let user = {
					id : '',
					name : "大佬",
					age : 26,
					sex : "女"
				}
				let url = "http://localhost:8090/axios/saveUser"
				axios.post(url,user).then(
					promise =>{
						console.log(promise.data)
					}
				)
		</script>
	</body>
</html>
